﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;



namespace GamePlay
{
     public class RandomObject:Game

    {
        public Texture2D Texture;
        public Vector2 Position;
        public  Vector2 velocity;
        //public int Gravity = 6;

        public float Gravity = 6.0f;
        private int index = 0;
        private int randonly =800;
        public float Width;
        

        //public Rectangle RecG;
        
        public Random random = new Random();
        //Rectangle rec4;
         
       
        

         public RandomObject()
        {

             //.X = random.Next(

            
            ///Position = new Vector2(400, 730);
            Position = new Vector2(0, 730);


        }
            public RandomObject(Texture2D texture, Vector2 position)
            {
                //Texture = texture;
                //Position = position;
            
             }
         public void Update()
         {
             //reference
             //Window.ClientBounds.Width;
             //Window.ClientBounds.Height

             Width = 100;
            

             gravity();

                 //Colizion
                 if (Position.Y >= Window.ClientBounds.Height)
                 {
                     Position.Y = Window.ClientBounds.Height - Window.ClientBounds.Height;
                     Position.X = random.Next(index, randonly);

                     
                 
                     //rec4.Height = Window.ClientBounds.X - rec4.Width; 

                     //Position.Y = random.Next(0, randonly);
                     //this.Position.X += 10;
                    
                     
                 }
            


            }
 
         

                     public void Draw(SpriteBatch spriteBatch)
                     {

                         spriteBatch.Draw(Texture, Position, Color.White);


                            }
                             public void gravity() 
                             {
                                 Position.Y += Gravity;
                             }
         
         

        
                }
            }
